#include "Event.H"
const EnumNamePair Event::EventIdToNameTable[] = 
{	
{ eAll_FIRST_HOUSE,    "et-ALL-FIRST-HOUSE=0"},
{ eALL_UPDATE,         "et-ALLL-UPDATE"	 },       
{ et_GIVE_FLOORS,      "et-GIVE-FLOORS"	},    
{ et_FORCED_BUILD,     "et-FORCED-BUILD"},   
{ et_ADD_MORE,         "et-ADD-MORE"},       
{ et_YOUR_TURN,	       "et-YOUR-TURN"},	   
{ et_TAKE_FROM_DECK,   "et-TAKE-FROM-DECK"}, 
{ et_PICK_MORE,        "et-PICK-MORE"},      
{ ep_HOUSE_INFO,       "ep-HOUSE-INFO"}, 
{ ep_LOOSE_THROW,      "ep-LOOSE-THROW"},    
{ ep_HOUSE_BUILD,      "ep-HOUSE-BUILD"},    
{ ep_HOUSE_LOOSE_ADD,  "ep-HOUSE-LOOSE_ADD"},
{ ep_HOUSE_ADD,	       "ep-HOUSE-ADD"},	   
{ ep_HOUSE_ADDFLOORS,  "ep-HOUSE-ADDFLOORS"},
{ ep_PICK,             "ep-PICK" },           
{ ep_DEAL_AGAIN,       "ep-DEAL-AGAIN"  },   
{ -1, NULL }
};

std::ostream & operator<<(std::ostream & os, Event &Evt )
{
	const char *name="UNKNOWN-EVENT";
	int i = 0;
	while ( Event::EventIdToNameTable[i].id != -1 )
	{
		if ( Event::EventIdToNameTable[i].id == Evt.What() )
		{
			name = Event::EventIdToNameTable[i].name;
			break;
		}
		i++;
	}
	os << "Event=" << name << " " ;
	return os;
}
